Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exact Inverse Relations: Equations 146, 150 ,156 through 160 with Support Lemmas #3

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

MohanadAhmed
Copy link
Contributor

@MohanadAhmed MohanadAhmed commented May 17, 2023

Exact Inverse Relations: Eq 146, 150, 156 through Eq 160

This Pull Request adds proofs for equations 156 through 160. In addition equations 156 and 158 have "Hermitianized" versions, where the Hermitian operator is used instead of the transpose. These might be more appropriate (or what the reader understands when thinking of comlelx matrices).

The file mat_inv_lib.lean contains support identities. These are:

  1. is_unit_of_pos_def: a positive definite matrix is also a unit determinant matrix (basically fancy way of saying determinant is nonzero).
  2. invertible_of_pos_def: a positive definite matrix is invertible.
  3. A_add_B_P_Bt_pos_if_A_pos_B_pos: Given $P,R$ positive definite the sum of $ R + BPB^H$ is positive definite.
  4. right_mul_inj_of_invertible: multiplication from the right by invertible matrices is injective.
  5. left_mul_inj_of_invertible: multiplication from the the left by invertible matrices is injective.
  6. unit_matrix_sandwich: a matrix unit unit R i.e. a matrix with one element interposed in an outerproduct can be removed to the left to be scalar multiplication by that one element.
    $$u,v \in \mathbb{C}^{m\times 1}, s \in \mathbb{C}^{1 \times 1} \to [s]_{1,1} (uv^t) = u \cdot s \cdot v^t$$

With $\cdot{}$, meaning matrix multiplication and $[A]_{ab}$ meaning element a,b from matrix $A$:

  1. row_mul_mat_mul_col: a weighted inner product of row and vector columns with a weight matrix in the middle can be regraded as scalar or one element matrix.
    $$u^T A v = u^T \cdot A \cdot v$$
  2. one_add_row_mul_mat_col_inv
    $$(1 + c^T A b)^{-1} = [(1 + u^T \cdot A \cdot v)^{-1}]_{1,1}$$

@MohanadAhmed MohanadAhmed changed the title eq156 through eq160 Exact Inverse Relations: Equations 156 through 160 with Support Lemmas May 17, 2023
Comment on lines 14 to 32
lemma is_unit_of_pos_def {A : matrix m m ℂ} (hA: matrix.pos_def A):
is_unit A.det :=
begin
rw is_unit_iff_ne_zero,
apply ne.symm,
cases hA with hAH hpos,
rw is_hermitian.det_eq_prod_eigenvalues hAH,
norm_cast,
rw ← ne.def,
apply ne_of_lt,
apply finset.prod_pos,
intros i _,
rw hAH.eigenvalues_eq,
apply hpos _ (λ h, _),
have h_det : (hAH.eigenvector_matrix)ᵀ.det = 0,
from matrix.det_eq_zero_of_row_eq_zero i (λ j, congr_fun h j),
simpa only [h_det, not_is_unit_zero] using
is_unit_det_of_invertible hAH.eigenvector_matrixᵀ,
end
Copy link
Owner

@eric-wieser eric-wieser May 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is a complex version of matrix.pos_def.det_pos? Can you make a PR to mathlib that generalizes that lemma to is_R_or_C 𝕜?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this one is a problem. We know because the matrix is positive definite that its determinant is a real number. But the way det is defined means for a $\mathbb{C}$ matrix the determinant is another complex number. Complex numbers have no less than operator as far as I know.

I think that is why the person who wrote matrix.pos_def.det_pos avoided it anyway. just to avoid the headache?

So I guess the question is given a matrix that is is_R_or_C how do you tell lean hey lean I know this determinant is going to be real number deal with it as such?

open_locale matrix big_operators


lemma is_unit_of_pos_def {A : matrix m m ℂ} (hA: matrix.pos_def A):
Copy link
Owner

@eric-wieser eric-wieser May 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lemma is_unit_of_pos_def {A : matrix m m ℂ} (hA: matrix.pos_def A):
lemma matrix.pos_def.complex_is_unit_det {A : matrix m m ℂ} (hA : matrix.pos_def A) :

Comment on lines 34 to 40
noncomputable lemma invertible_of_pos_def {A : matrix m m ℂ} {hA: matrix.pos_def A}:
invertible A :=
begin
apply invertible_of_is_unit_det,
apply is_unit_of_pos_def,
exact hA,
end
Copy link
Owner

@eric-wieser eric-wieser May 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this one is worth having, if you need it you can use invertible_of_is_unit_det hA.complex_is_unit_det

(P : matrix m m ℂ) (R : matrix n n ℂ) (B : matrix n m ℂ)
-- [invertible P] [invertible R]
(hP: matrix.pos_def P) (hR: matrix.pos_def R) :
matrix.pos_def (B⬝P⬝Bᴴ + R) :=
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two separate lemmas hiding here I think:

  • pos_def.add (hP: matrix.pos_def A) (hR: matrix.pos_def B) : matrix.pos_def (A + B)
  • pos_def.hermitian_conj (hP: matrix.pos_def P) : matrix.pos_def (B⬝P⬝Bᴴ)

@MohanadAhmed MohanadAhmed marked this pull request as draft May 19, 2023 08:16
@MohanadAhmed MohanadAhmed changed the title Exact Inverse Relations: Equations 156 through 160 with Support Lemmas Exact Inverse Relations: Equations 146, 50 156 through 160 with Support Lemmas May 23, 2023
@MohanadAhmed MohanadAhmed changed the title Exact Inverse Relations: Equations 146, 50 156 through 160 with Support Lemmas Exact Inverse Relations: Equations 146, 150 ,156 through 160 with Support Lemmas May 23, 2023
@eric-wieser eric-wieser added the lean3 This PR needs converting to Lean 4 if it is not already merged label Jan 7, 2024
Comment on lines +113 to +115
lemma pos_def.add_semidef {A: matrix m m R} {B: matrix m m R}
(hA: matrix.pos_def A) (hB: matrix.pos_semidef B) : matrix.pos_def (A + B) :=
begin
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lean3 This PR needs converting to Lean 4 if it is not already merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants